package com.fary.resource;

import org.springframework.core.io.UrlResource;

import java.io.IOException;

public class TestUrlResource {

	public static void main(String[] args) throws IOException {
		UrlResource resource = new UrlResource("http://www.baidu.com");
		if (resource.isReadable()) {
			//URLConnection对应的getInputStream()。
			PrintResource.printContent(resource.getInputStream());
		}
	}
}
